#ifndef __EXCEPTION_H__
#define __EXCEPTION_H__

#include "TypeDef.h"

namespace Woo {

class Exception
{
public:
	Exception();
	Exception(string msg);
	Exception(string msg, string file, unsigned int line);
	virtual ~Exception();

	string GetSource();
	string GetStackInfo();
	string GetMessage();
	void SetMessage(string msg);

protected:
	string	m_ErrorMessage;
	string	m_StackTraceInfo;
	string	m_SourceInfo;

private:
	void StackTrace();
};

class NotImplementedException :
	public Exception
{
public:
	NotImplementedException();
	NotImplementedException(string msg);
	NotImplementedException(string msg, string file, unsigned int line);
	virtual ~NotImplementedException();
};

class NotSupportedException :
	public Exception
{
public:
	NotSupportedException();
	NotSupportedException(string msg);
	NotSupportedException(string msg, string file, unsigned int line);
	~NotSupportedException();
};

class IndexOutOfRangeException :
	public Exception
{
public:
	IndexOutOfRangeException();
	IndexOutOfRangeException(string msg);
	IndexOutOfRangeException(string msg, string file, unsigned int line);
	~IndexOutOfRangeException();
};

class ArgumentException :
	public Exception
{
public:
	ArgumentException();
	ArgumentException(string msg);
	ArgumentException(string msg, string file, unsigned int line);
	~ArgumentException();
};

class ArgumentNullException :
	public ArgumentException
{
public:
	ArgumentNullException();
	ArgumentNullException(string msg);
	ArgumentNullException(string msg, string file, unsigned int line);
	~ArgumentNullException();
};

namespace IO {

class IOException :
	public Exception
{
public:
	IOException();
	IOException(string msg);
	IOException(string msg, string file, unsigned int line);
	~IOException();
};

class DirectoryNotFoundException :
	public IOException
{
public:
	DirectoryNotFoundException();
	DirectoryNotFoundException(string msg);
	DirectoryNotFoundException(string msg, string file, unsigned int line);
	~DirectoryNotFoundException();
};

class FileNotFoundException :
	public IOException
{
public:
	FileNotFoundException();
	FileNotFoundException(string msg);
	FileNotFoundException(string msg, string file, unsigned int line);
	~FileNotFoundException();
};

class StreamException :
	public IOException
{
public:
	StreamException();
	StreamException(string msg);
	StreamException(string msg, string file, unsigned int line);
	~StreamException();
};

class StreamOpenException :
	public StreamException
{
public:
	StreamOpenException();
	StreamOpenException(string msg);
	StreamOpenException(string msg, string file, unsigned int line);
	~StreamOpenException();
};

class StreamReadException :
	public StreamException
{
public:
	StreamReadException();
	StreamReadException(string msg);
	StreamReadException(string msg, string file, unsigned int line);
	~StreamReadException();
};

class StreamWriteException :
	public StreamException
{
public:
	StreamWriteException();
	StreamWriteException(string msg);
	StreamWriteException(string msg, string file, unsigned int line);
	~StreamWriteException();
};

class StreamClosedException :
	public StreamException
{
public:
	StreamClosedException();
	StreamClosedException(string msg);
	StreamClosedException(string msg, string file, unsigned int line);
	~StreamClosedException();
};

} // namespace IO

} // namespace Woo

#endif // define __EXCEPTION_H__
